package com.dadao.boot.test.web;

import com.dadao.boot.test.entity.StudentVo;
import com.dadao.boot.test.service.impl.StudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

@Slf4j
@RestController
@RequestMapping("student")
public class StudentServer {

    @Autowired
    private StudentService studentService;

    @RequestMapping("/{id}")
    public StudentVo queryById(@PathVariable int id){
        log.debug("id="+id);
        return studentService.selectStudentById(id);
    }
}
